def cardinal(num):
	"""Returns a string giving the cardinal number, eg. "1st"."""
	if isinstance(num, int):
		num = str(num)
	
	if num[-1] == "1":
		return num + "st"
	elif num[-1] == "2":
		return num + "nd"
	elif num[-1] == "3":
		return num + "rd"
	else:
		return num + "th"